#ifndef PIZZASTORE_HPP
#define PIZZASTORE_HPP

#include <iostream>
#include "Pizza.hpp"

class PizzaStore
{
  protected:
  public:
    virtual Pizza* CreatePizza(std::string) = 0;

    // 有披萨订单
    void OrderPizza(std::string type)
    {
      // 制作披萨
      Pizza* _pizza = CreatePizza(type);

      // 处理披萨
      _pizza->Prepare();
      _pizza->Bake();
      _pizza->Cut();
      _pizza->Box();

      std::cout << "您的" << type << "正在运送中，请稍等！" << std::endl;
    }
};

class NYPizzaStore :public PizzaStore
{
  protected:
  Pizza* _pizza;

  public:
    NYPizzaStore()
      :_pizza(nullptr)
    {}

    Pizza* CreatePizza(std::string type)
    {
      if(type == "CheesePizza")
      {
        _pizza = new NYStyleCheesePizza(); 
      }
      else if(type == "VeggiesPizza")
      {
        _pizza = new NYStyleVeggiesPizza(); 
      }
      else if(type == "ClamPizza")
      {
        _pizza = new NYStyleClamPizza();
      }
      return _pizza;
    }

    ~NYPizzaStore()
    {
      if(_pizza != nullptr)
        delete _pizza;
    }
};

// 生意过于火爆，老板有资金开连锁店了
class ChicagoPizzaStore :public PizzaStore
{
  protected:
  public:
};

#endif
